<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
  //创建标签 document.createElement 创建
  let d = document.createElement("div")
  //给div设置显示文本
  d.innerText = "我是div";
  //把div添加到body里 appendChild添加一个子元素
  document.body.appendChild(d);
  let h1 = document.createElement("h1");
  let h2 = document.createElement("h2");
  h1.innerText = "h1";
  h2.innerText = "h2";
  document.body.append(h1,h2);
  //创建图片并添加
  let i = document.createElement("img");
  //给元素设置属性 别的也是直接点就可以
  i.src="../day01/a.jpg";
  //添加到页面
  document.body.append(i);

</script>
</body>
</html>